/**
 * Copyright (c) 2017 Dell Inc., or its subsidiaries. All Rights Reserved.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 */
package io.pravega.connectors.flink.utils;

import org.apache.flink.api.common.serialization.AbstractDeserializationSchema;

import java.io.IOException;
import java.nio.ByteBuffer;

public class IntegerDeserializationSchema extends AbstractDeserializationSchema<Integer> {
    @Override
    public Integer deserialize(byte[] message) throws IOException {
        return ByteBuffer.wrap(message).getInt();
    }

    @Override
    public boolean isEndOfStream(Integer nextElement) {
        return false;
    }
}
